HDFS-16377. Should CheckNotNull before access FsDatasetSpi#3784
Merged
tasanuma merged 2 commits intoapache:trunkfrom Dec 16, 2021
Merged
HDFS-16377. Should CheckNotNull before access FsDatasetSpi#3784tasanuma merged 2 commits intoapache:trunkfrom
tasanuma merged 2 commits intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
virajjasani
approved these changes
Dec 10, 2021
Contributor
virajjasani
left a comment
There was a problem hiding this comment.
+1 (non-binding). Makes sense to include this check for the remaining Datanode APIs that are triggered by DFSAdmin e.g. getVolumeReport(), refreshVolumes() etc. Thanks @tomscut
Contributor
Author
|
Thanks @virajjasani for your review. |
Contributor
Author
|
Hi @aajisaka @tasanuma @jojochuang @Hexiaoqiao , PTAL. Thanks. |
tasanuma
reviewed
Dec 15, 2021
...-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Outdated
Show resolved
Hide resolved
|
💔 -1 overall
This message was automatically generated. |
Member
|
Thanks for your contribution, @tomscut, and thanks for your review, @virajjasani. |
tasanuma
pushed a commit
that referenced
this pull request
Dec 16, 2021
Reviewed-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 22f5e18)
tasanuma
pushed a commit
that referenced
this pull request
Dec 16, 2021
Reviewed-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 22f5e18)
hotcodemacha
pushed a commit
to hotcodemacha/hadoop
that referenced
this pull request
Dec 22, 2021
Reviewed-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
sunchao
pushed a commit
that referenced
this pull request
Jan 4, 2022
Reviewed-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 22f5e18)
HarshitGupta11
pushed a commit
to HarshitGupta11/hadoop
that referenced
this pull request
Nov 28, 2022
Reviewed-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
jojochuang
pushed a commit
to jojochuang/hadoop
that referenced
this pull request
May 23, 2023
apache#3784) Reviewed-by: Viraj Jasani <vjasani@apache.org> Signed-off-by: Takanobu Asanuma <tasanuma@apache.org> (cherry picked from commit 22f5e18) (cherry picked from commit 3257646) Change-Id: Icae290571be06f81cd15f82441201a201d350d9f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: HDFS-16377.
When starting the DN, we found NPE in the staring DN's log, as follows:

The logs of the upstream DN are as follows:

This is mainly because
FsDatasetSpihas not been initialized at the time of access.I noticed that checkNotNull is already done in these two method(
DataNode#getBlockLocalPathInfoandDataNode#getVolumeInfo). So we should add it to other places(interfaces that clients and other DN can access directly) so that we can add a message(Storage not yet initialized) when throwing exceptions.Therefore, the client and the upstream DN know that
FsDatasetSpihas not been initialized, rather than blindly unaware of the specific cause of the NPE.